package com.kfm.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

@RestController
public class UploadController {

    @RequestMapping("/upload")
    public String upload(MultipartFile file){
        try {
            file.transferTo(new File("d://temp//1.jpg"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "上传成功";
    }
}
